package com.lnu_devteam.zongce.common;

/**
 * @description 错误码
 * @author xbaozi
 * @date 2022/12/14 14:58
 **/
public enum ErrorCode {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    LOGIN_ERROR(40102, "账号或密码错误"),
    PASSWORD_NOT_FORMAT(40103, "密码不匹配"),
    PASSWORD_NOT_CHANGE(40104, "新密码与旧密码相同"),
    SIGNATURE_VERIFICATION(40105, "签名不一致"),
    TOKEN_EXPIRED(40106, "令牌过期"),
    ALGORITHM_MISMATCH(40107, "签名算法不匹配"),
    INVALID_CLAIM(40108, "payload不可用"),
    VERIFY_ERROR(40109, "无效token"),
    LOGIN_EXPIRED(40110, "登录超时"),
    UPLOAD_ERROR(40200, "文件导入失败"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    PUBLICITY_IS_EXIST(40500, "公示数据已存在"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
